Repository navigation
feat: Add a daily check of the SBOM quality of the 0.0.0-dev images - #1756
Conversation
4787630 to
cd62f92
Compare
Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
NickLarsenNZ
left a comment
There was a problem hiding this comment.
Just in general, I think we should convert external input (strings) into valid types (with no pub fields to bypass construction rules) as soon as possible, then work with those valid types.
Not a huge deal for a small utility app, but a good habit nonetheless.
Agree in general, it can sometimes make the code slightly harder to read IMO (see 75ce2f8 for example). For libraries I'd do it, for binaries... no strong opinion, fine with both. |
Yeah I understand, and it is less important. But I do think as code changes over time, this loseness can bite. It's where bugs come from. We should use the advantages of Rust. |
Description
Part of stackabletech/issues#822
Adds
sbom-quality(rust/sbom-quality), a tool that checks the SBOMs attested to our published images, and a workflow that runs it daily against the0.0.0-devimages. The goal is to notice within a day when a change makes our SBOMs worse instead of at the next manual audit.For every product version and operator, both architectures, it fetches the CycloneDX and SPDX SBOMs and checks:
cyclonedx-bom, licenses are valid SPDX expressions, both documents list the same packages and both architectures list the same components.rust/sbom-quality/expectations.toml: the product itself is listed in the version of the image, components come from each build-time SBOM the image should contain, and there are at least so many components in total, per ecosystem and per ecosystem from build-time SBOMs. The floors are 20% below the current counts and can be regenerated withcargo sbom-quality --suggest-floors.A new product without expectations fails the check, so it cannot be forgotten.
The workflow runs at 07:30 UTC, after the scheduled image builds, and fails if there is an error finding.
It does not notify anyone, the status of the latest run is meant to be watched from outside. The summary page shows the findings grouped per check, the log has every finding with every affected image.
Note
The check expects the SBOMs that
publish-imagewrites once stackabletech/actions#153 and stackabletech/actions#154 are in use (CycloneDX 1.7, finalized by mergebom). Until they are merged and released and the images are rebuilt, every image fails the format checks and the workflow stays red.Run it locally from the repository root (needs
craneandcosign):rust/sbom-quality/README.mdexplains what is checked and why, and how to update the expectations.Definition of Done Checklist
Note
Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant.
Please make sure all these things are done and tick the boxes
TIP: Running integration tests with a new product image
The image can be built and uploaded to the kind cluster with the following commands:
See the output of
boilto retrieve the image manifest URI for<MANIFEST_URI>.